<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="content-language" content="zh-CN"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
    <meta name="renderer" content="webkit"/>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="format-detection" content="telephone=no"/>
    <title>义乌海烨电子</title>
    <link rel="Bookmark" type="image/x-icon" href="__STATIC__/favicon.ico">
    <link rel="Shortcut Icon" type="image/x-icon" href="__STATIC__/favicon.ico"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/app.css"/>
</head>

<body>
<style type="text/css">
    .m_header {
        background: #f2f2f2;
    }
</style>
<div class="pg_computefinish">
    <form method="post" action="{:U('/Mobile/Evaluation/computefinishHandle')}" id="add_post">
        <input type="hidden" name="f_id" value="{$f_id}">
        <input type="hidden" name="s_id" value="{$s_id}">
        <input type="hidden" name="t_id" value="{$t_id}">
        <input type="hidden" name="evaluation_id_text" value="{$evaluation_id_text}">
        <input type="hidden" name="do_type" value="1">
        <header class="m_header">
            <a href="javascript:history.back(1)" class="back"></a>
            <div class="title">{$goods_cat.name}</div>
        </header>
        <div class="coa">
            <span>预估回收价格</span>
            <div class="price">
                ￥
                <font>{$new_money}</font>
            </div>
            <div class="other">对估价不满意？电话联系：{$tpshop_config['shop_info_mobile']}</div>
        </div>
        <div class="cob">
            <div class="cata cata_btn">
                <span class="on" data-id="1">去门店</span>
                <span data-id="2">约上门</span>
            </div>
            <div class="txt">
                <div class="ipt">
                    <input type="text" name="mobile1" id="mobile1" class="ipt" placeholder="请输入您的手机号" value=""/>
                </div>
                <div class="text">
                    <h3>门店地址</h3>
                    <p>{$tpshop_config['shop_info_shop_address']}</p>
                </div>
            </div>
            <div class="txt none">
                <div class="ipt">
                    <input type="text" name="mobile2" id="mobile2" class="ipt" placeholder="请输入您的手机号" value=""/>
                </div>
                <div class="ipt">
                    <input type="text" name="shop_address" id="shop_address" class="ipt" placeholder="请输入上门地址" value=""/>
                </div>
            </div>
        </div>
        <div class="btn">
            <button type="button" onclick="checkForm()">提交</button>
        </div>
    </form>
</div>
<script src="__STATIC__/js/jquery.js"></script>
<script src="__STATIC__/js/app.js"></script>
<script type="text/javascript">
    $(".cata_btn span:first").addClass("on");
    $(".txt:first").show();
    $(".cata_btn span").click(function () {
        var data_id = $(this).attr("data-id");
        $('input[name=do_type]').val(data_id);

        $(".cata_btn span").removeClass("on");
        $(this).addClass("on");
        var linum = $(this).index();
        $(".txt").hide();
        $(".txt").eq(linum).show();
    });

    function checkForm() {
        var do_type = $('input[name=do_type]').val();
        var mobile1 = $('input[name=mobile1]').val();
        var mobile2 = $('input[name=mobile2]').val();
        var shop_address = $('input[name=shop_address]').val();

        if (parseInt(do_type) == 1) {
            if(!mobile1) {
                alert("请填写手机号！");
                return false;
            }
        }
        if (parseInt(do_type) == 2) {
            if(!mobile2) {
                alert("请填写手机号！");
                return false;
            }
            if(!shop_address) {
                alert("请填写上门地址！");
                return false;
            }
        }

        $('#add_post').submit();
    }
</script>
</body>
</html>
